<?php
/**
 *
 * User: anker
 * Date: 4/24/22
 * Email: <13408046898@163.com>
 **/

use think\facade\Route;

//必须登录
Route::group(function () {

    // 科目列表
    Route::rule("subject", "study/subject", "get");
    // 课件列表
    Route::rule("courseware", "study/courseware", "get");
    // 获取单个课件
    Route::rule("one_courseware", "study/one_courseware", "get");

    // 习题列表
    Route::rule("exercises", "study/exercises", "get");

    // 获取单个习题
    Route::rule("one_exercises", "study/one_exercises", "get");

    // 获取学生信息
    Route::rule("get_info", "student/get_info", "get");

    // 提交习题答案
    Route::rule("edit_answer", "study/edit_answer", "POST");

    // 笔记列表
    Route::rule("note", "study/note", "get");

    // 新增笔记
    Route::rule("add_note", "study/add_note", "POST");

    // 修改笔记
    Route::rule("edit_note", "study/edit_note", "POST");

    // 删除笔记
    Route::rule("del_note", "study/del_note", "POST");

    // 获取单个笔记
    Route::rule("one_note", "study/one_note", "get");

    // 修改用户密码
    Route::rule("updatePassword", "student/updatePassword", "POST");

    // 获取单个提交的答案
    Route::rule("one_answer", "study/one_answer", "get");

    // 退出登陆
    Route::rule("logout", "student/logout", "POST");

})->middleware(\app\api\middleware\Auth::class);

//不用登录
Route::group(function () {

    // 班级列表
    Route::rule("classes", "student/classes", "get");
    // 学生列表
    Route::rule("student", "student/student", "get");
    // 某个学生
    Route::rule("student_one", "student/student_one", "get");

    // 学习报告列表
    Route::rule("study_report", "study/study_report", "get");
    // 获取单个学习报告
    Route::rule("one_study_report", "study/one_study_report", "get");


    //密码登录
    Route::rule("login", "student/login", "POST");

})->middleware(\app\api\middleware\Api::class);